package com.lions.client.view.basepanel;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.StackLayoutPanel;
import com.lions.client.controller.Controller;
import com.lions.client.model.Model;
import com.lions.client.view.mappanel.MapPanel;

/**
 * 
 *
 *
 */
public class BasePanel extends StackLayoutPanel {

	/**
	 * Default constructor takes a reference to the module list (Model) and a
	 * reference to the button panel (Controller)
	 */
	public BasePanel(Model m, final MapPanel map) {
		super(Unit.EM);
		model = m;
		mapPanel = map;

		setStyleName("splitlayoutstyle");
	}
	
	public void populate() {
		if (model.checkMin()) {
			config1 = new ConfigurationsPanel(model, mapPanel, "images/base1.jpg", 
					0,0,1,0,0,1,-1,1,0,2,1,-1,0,-1,2,0,-1,0,1,1);
			config2 = new ConfigurationsPanel(model, mapPanel, "images/base2.jpg", 
					0,0,0,1,1,1,1,2,2,1,-1,0,-1,1,0,-1,0,2,1,0);
			config3 = new ConfigurationsPanel(model, mapPanel, "images/base3.jpg",
					0,0,0,1,-1,1,1,0,0,-1,-1,2,0,2,-2,1,1,1,-1,0);
			config4 = new ConfigurationsPanel(model, mapPanel, "images/base4.jpg", 
					0,0,-1,0,0,1,-1,-1,-2,0,1,1,1,0,0,2,0,-1,-1,1);
			config5 = new ConfigurationsPanel(model, mapPanel, "images/base5.jpg",
					0,0,-1,0,1,0,1,1,1,-1,0,1,-1,1,-1,-1,-2,0,2,0);
			config6 = new ConfigurationsPanel(model, mapPanel, "images/base6.jpg",
					0,0,0,-1,0,1,1,-1,-1,-1,1,0,1,1,-1,1,0,2,0,-2);
			config7 = new ConfigurationsPanel(model, mapPanel, "images/base7.jpg",
					0,0,-1,0,1,0,-1,-1,-1,1,0,-1,1,-1,1,1,2,0,-2,0);
			config8 = new ConfigurationsPanel(model, mapPanel, "images/base8.jpg",
					0,0,0,-1,0,1,-1,1,1,1,-1,0,-1,-1,1,-1,0,-2,0,2);
			
			this.add(config1, "Minimum Base 1", 1.8);
			this.add(config2, "Minimum Base 2", 1.8);
			this.add(config3, "Minimum Base 3", 1.8);
			this.add(config4, "Minimum Base 4", 1.8);
			this.add(config5, "Minimum Base 5", 1.8);
			this.add(config6, "Minimum Base 6", 1.8);
			this.add(config7, "Minimum Base 7", 1.8);
			this.add(config8, "Minimum Base 8", 1.8);
		}
	}
	
	private ConfigurationsPanel config1;
	private ConfigurationsPanel config2;
	private ConfigurationsPanel config3;
	private ConfigurationsPanel config4;
	private ConfigurationsPanel config5;
	private ConfigurationsPanel config6;
	private ConfigurationsPanel config7;
	private ConfigurationsPanel config8;
	private Model model;
	private MapPanel mapPanel;
}
